package com.cn.goodsadmin.requestinfo;

import com.alibaba.fastjson.JSONObject;
import com.cn.goodsadmin.common.frame.BaseNetAns;
import com.cn.goodsadmin.common.frame.BaseNetWork;

public class WxSendMsgAns extends BaseNetAns {
    @Override
    public void onReadyAns(BaseNetWork baseNetWork) {

    }

    @Override
    public void onStartAns(BaseNetWork baseNetWork) {

    }

    @Override
    public void onDowningAns(byte[] buf, int len, long downsize, BaseNetWork baseNetWork) {

    }

    @Override
    public void onReceiveAns(BaseNetWork baseNetWork) {
        try {
            String content = new String(baseNetWork.content, "utf-8");
            System.out.println("WxSendMsgAns="+content);
            JSONObject object=JSONObject.parseObject(content);
            int code=object.getInteger("errcode");
            if(code!=0){
                isError=true;
            }
        }catch (Exception e){
            isError=true;
        }
    }

    @Override
    public void onStopAns(BaseNetWork baseNetWork) {

    }

    @Override
    public void onErrorAns(BaseNetWork baseNetWork) {
        isError=true;
    }
}
